import request from "@/utils/request";

/**
 * 用户登录
 * @param data
 * @returns {*}
 */
export function login(data) {
    return request({
        url: '/api/login',
        method: 'POST',
        data
    })
}

/**
 * 获取当前登录用户信息
 * @param token
 * @returns {*}
 */
export function getLoginInfo(token) {
    return request({
        url: '/api/getLoginInfo',
        method: 'GET',
        params: {token}
    })
}

/**
 * 退出登录
 * @returns {*}
 */
export function logout(token) {
    return request({
        url: '/api/logout',
        method: 'POST',
        params: {token}
    })
}

export function getUserById(id) {
    return request({
        url: `/sys/user/${id}`,
        method: 'GET'
    })
}

